package com.ericsson.eritask.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ericsson.eritask.dao.ShowTaskDao;
import com.ericsson.eritask.dao.UserProjectDao;
import com.ericsson.eritask.dao.UserTaskDAO;
import com.ericsson.eritask.domain.UserProject;
import com.ericsson.eritask.domain.UserTask;
import com.ericsson.eritask.dto.MyTaskDTO;
import com.ericsson.eritask.dto.ProjectDTO;
import com.ericsson.eritask.service.MyTaskService;

@Service
public class MyTaskServiceImpl implements MyTaskService{
	
	@Autowired
	ShowTaskDao showTaskDao;
	
	@Autowired
	UserTaskDAO userTaskDao;

	@Autowired
	UserProjectDao userProjectDao;
	
	public void setUserProjectDao(UserProjectDao userProjectDao) {
		this.userProjectDao = userProjectDao;
	}

	@Override
	public List<MyTaskDTO> populateMyTaskList(Integer projId) {
		// TODO Auto-generated method stub
		List<MyTaskDTO> l = new ArrayList<MyTaskDTO>();
		l = showTaskDao.showMyTaskList(projId);
		return l;
	}

	public void setShowTaskDao(ShowTaskDao showTaskDao) {
		this.showTaskDao = showTaskDao;
	}

	@Override
	public List<UserProject> getUserProjectList(String user_name ,String pass) {
		// TODO Auto-generated method stub
		List<UserProject> list=	userProjectDao.getUserProjectDtls(user_name, pass);
		return list;
	}

	@Override
	public List<UserTask> getUserTaskList(String signum) {
		List<UserTask> list=userTaskDao.getUsertaskDtls(signum);
		return list;
	}

	@Override
	public List<MyTaskDTO> populateMyUserTaskList(Integer projId) {
		List<MyTaskDTO> l = new ArrayList<MyTaskDTO>();
		l = showTaskDao.showMyUserTaskList(projId);
		return l;
	}
	
	

}
